import { Company } from '@/pages/authority/utils/auth.type';

export interface Scale {
  id?: number;
  nameCN: string;
  nameEN: string;
  shortNameCN?: string;
  shortNameEN?: string;
  questionNum: number;
  demensionNum: number;
  introduce: string;
  banner?: string;
  level: number;
  type: number;
  isOnline: boolean;
  isCommon: boolean;
  author: string;
  createTime: Date;
}

export interface Question {
  id?: number;
  title: string;
  idx: number;
  choices: string[];
}

interface Polymerize {
  type: string;
  includes?: number[] | string[];
  fens?: string;
  choice?: string;
  demensions?: string[];
  demensionType?: string;
}

interface DecideType {
  symbol: string;
  result: string;
  val?: string;
  val1?: string;
  val2?: string;
}
interface NormType {
  mA: string;
  mB: string;
  wA: string;
  wB: string;
}
interface ResultConfig {
  type: string;
  decides: DecideType[];
  norm: NormType;
}

interface DemensionReportConfig {
  sex: string;
  age: string | number;
  max: string | number;
  min: string | number;
  message: string;
}
export interface Demension {
  id?: number;
  nameCN: string;
  nameEN: string;
  introduce: string;
  scaleId?: number;
  rule?: string;
  train: string;
  polymerize: Polymerize[];
  result: ResultConfig;
  reports: DemensionReportConfig[];
}

export interface ScaleInfo extends Scale {
  demensions: Demension[];
  questions: Question[];
}

export interface User {
  id?: number;
  username: string;
  password: string;
  phone: string;
  code?: string;
  avantar?: string;
  isStudent: boolean;
  classify: string;
  adminId?: number;
  companyId?: number;
  publicIds?: string;
  userId: number;
  realName?: string;
  sex?: string;
  birth?: Date;
  nation?: string;
  idCode?: string;
  email?: string;
  address?: string;
  bloodType?: string;
  recordOfSchool?: string;
  politicalStatus?: string;
  handedness?: string;
  marriage?: string;
  workTime?: string;
  preschoolLifeWith?: string;
  preschoolEduModule?: string;
  juniorSchoolLifeWith?: string;
  juniorSchoolEduModule?: string;
  juniorMiddleSchoolLifeWith?: string;
  juniorMiddleSchoolEduModule?: string;
}

export interface Record {
  choice: string;
  idx: number;
}

interface DemensionReport {
  nameCN: string;
  nameEN: string;
  introduce: string;
  report: string;
  result: string | number;
}

export interface ReportData {
  scaleInfo: Scale;
  companyInfo: Company;
  userInfo: User;
  record: Record[];
  demensions: DemensionReport[];
}

export interface ReportConfig {
  type: string;
  config: any;
}
